<?php
/**
 * 积分管理模型
 * 
 * @author  Lee<a605333742@gmail.com>
 * @time    2016-07-31
 */
namespace Model;
use Think\Model;

class UserIntegralRecordModel extends Model{
    /*
     * 删除积分记录
     * 
     * @return bool
     */
    public function del($where){
        $g  =$where['recordId'];
        if(is_array($where['recordId'])){
            $g  =implode(',',$where['recordId']);
            $where['recordId']=array("in",implode(',',$where['recordId']));            
        }
        if($this->where($where)->delete()){
            $data=array(
                "user_id"   =>session("authId"),
                'content'   =>"删除了recordId为 ".$g." 的积分记录信息",
                "add_time"  =>time()
            );
            if(M("Log")->add($data)){
                return TRUE;
            }else{
                return FALSE;
            }
        }
    }
}